home *** CD-ROM | disk | FTP | other *** search
- <head>
- <SCRIPT language="javascript">
- function Valider(inscription){
- if (inscription.email.value=="")
- {
- alert("Veuillez indiquer votre adresse email.");
- inscription.email.focus();
- return false;
- }
- if ((inscription.email.value.indexOf("@",0)<0)&&(inscription.email.value.indexOf(".",0)<0))
- {
- alert("Adresse email incorrecte. \nVeuillez corriger;");
- inscription.email.focus();
- return false;
- }
- if (inscription.age.value=="")
- {
- alert("Veuillez indiquer votre âge.");
- inscription.age.focus();
- return false;
- }
- if (isNaN(inscription.age.value))
- {
- alert("Votre âge n'est pas correct. \nVeuillez corriger.");
- inscription.age.focus();
- return false;
- }
- alert("Formulaire envoyé");
- inscription.submit();
- }
- </SCRIPT>
- </head>
- <body>
- <form action="mailto:webmaster@abc.fr?subject='formulaire visiteur'" method="post" name="inscription">
- <p>Votre nom<br>
- <input type="text" name="nom" size=20 maxlength=30 value="Qui etes-vous ?" onFocus="if (this.value=='Qui etes-vous ?'){this.value=' '}">
- </p>
- <p>Votre adresse email<br>
- <input type="text" name="email" size=20></p>
- <p>Quel âge avez-vous ?
- <input type="text" name="age" size=2 maxlength=2> ans
- </p>
- <input type="button" value="Envoyer" onClick="Valider(this.form)">
- <input type="reset" value="Annuler">
- </p>
- </form>
- </body>
-
-